<!DOCTYPE html>
<html lang="en">
	<head>
	    <meta charset="utf-8">
	    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
	    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
	    <title>投稿</title>
	    <link rel="stylesheet" type="text/css" href="css/aui.css">
	    <link rel="stylesheet" href="css/my.css" />
	    <link rel="stylesheet" href="css/style.css" />
		<link rel="stylesheet" href="js/layer/need/layer.css" />
	    <style>
			.aui-background-ea{
				background: #eaeaea;
			}
			.aui-mytext-active{
				height: 1.5rem;
				
			}
			.Eleditor-placeholder{
				text-align: center;
			}
			.aui-send-btn{
				position: fixed;
				bottom:0rem;
				left: 0rem;
			}
			.Eleditor-active {
			    color: #fff!important;
			}
	    </style>
	</head>
	<body class="aui-background-f6">
	    <!--header-->
	    
		<header class="aui-bar aui-bar-nav aui-background-white aui-bar-nav-search aui-text-default">
			<a class="aui-pull-left aui-btn" href="JavaScript:history.go(-1)">
				<span class="aui-iconfont aui-icon-left aui-text-gray aui-font-size-14"></span>
			</a>
			<div class="aui-title aui-font-size-14">
				我要投稿
			</div>
		</header>
		<div class="aui-content" style="margin-top: 3rem;">
			<div class="aui-mytext-active aui-border-b aui-padded-l-15 aui-font-size-14 aui-padded-r-15 aui-font-weight aui-text-gray aui-padded-b-5">			
				活动规则 <span class="aui-pull-right aui-slide-toggle"><i class="aui-iconfont aui-icon-down aui-font-size-12"></i></span>
			</div>
			<div class="aui-hide aui-slide-text aui-background-ea aui-text-gray aui-font-size-12 aui-padded-l-15 aui-padded-t-5 aui-padded-b-5 aui-padded-r-15">
				<ul>
					<li class="aui-margin-b-5">
						1.每天均可投稿，字数不少于200字。
					</li>
					<li class="aui-margin-b-5">
						2.作文转接评选入围的作品，于本周四17:00公布本周入围名单
					</li>
					<li class="aui-margin-b-5">
						3.所有入围作品将列入范文库，通过为期一周的点赞排行，排行前20名评为本期状元，并获得专家点评。最终结果将于第二周周四17:00封榜公布。
					</li>
					<li class="aui-margin-b-5">
						4.推荐投稿单元作文，入围后将同步展示在对应单元作文PK榜中，被更多人看到，获得更多赞。
					</li>
				</ul>
			</div>
			
			<div class="aui-mytext-title aui-margin-b-5 aui-background-white aui-margin-b-5">
				<input type="text" placeholder="请输入您的作文标题" id="title"/>
			</div>
			<div class="aui-padded-l-15 aui-padded-r-15 aui-mytext-content aui-background-white aui-padded-b-10 aui-position-relative aui-padded-t-10" id="content">
				
			</div>
			<div class="aui-padded-l-15 aui-padded-r-15 aui-margin-t-15" >
				<button class="aui-send-btn aui-font-size-18" onclick="fabu()">
					发布征稿
				</button>
			</div>
			<div class="aui-foot-height"></div>
			<div class="aui-foot-height"></div>
		</div>
	    
		
	
	    <script src="js/jquery-1.7.2.min.js"></script>
		<script src="js/islogin.js"></script>
		<script src="js/layer/layer.js"></script>
		<script src="js/eleditor/Eleditor.js" type="text/javascript"></script>
		<script src="js/eleditor/webuploader.min.js"></script>
	    <script>
			var baseurl = 'http://kt.zhangzhengjiang.top/api/';
			var Edr = new Eleditor({
						 el: '#content',
						 upload:{
							server: baseurl+'index/upload_t',
							formName: 'file'
						 },
				 });
			$('body').on('click','.aui-slide-toggle',function(){
				$('.aui-slide-text').toggle()
			})
			
			function fabu(){
				var title = $('#title').val();
				var content = Edr.getContent();
				var uid = window.localStorage.getItem('uid');
				if(title&&content){
					$.ajax({
						url:baseurl+'index/addTougao',
						type:'post',
						data:{title:title,uid:uid,content:content},
						success:function(res){
							if(res.code == 1){
							  layer.open({
								content: res.msg
								,skin: 'msg'
								,time: 2   
							  });
							  setTimeout(function(){
								    window.location.href='./textList.html';
							  },2000);
							}else{
								layer.open({
									content: res.msg
									,skin: 'msg'
									,time: 2 ,//2秒后自动关闭
									
								});
								setTimeout(function(){
								    window.location.href='./textList.html';
								},2000);
							}
						}
					})
				}
			}
	    </script>
	
	</body>

</html>
